package queryWrapper

import "fmt"

func Eq(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " = ?", Args: args}
}

func Gt(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " > ?", Args: args}
}

func Ge(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " >= ?", Args: args}
}

func Lt(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " < ?", Args: args}
}

func Le(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " <= ?", Args: args}
}

func Like(column string, keyword interface{}) *WherePair {
	return &WherePair{Query: column + " LIKE ?", Args: []interface{}{"%" + fmt.Sprintf("%v", keyword) + "%"}}
}

func NotLike(column string, keyword interface{}) *WherePair {
	return &WherePair{Query: column + " NOT LIKE ?", Args: []interface{}{"%" + fmt.Sprintf("%v", keyword) + "%"}}
}

func LikeLeft(column string, keyword interface{}) *WherePair {
	return &WherePair{Query: column + " LIKE ?", Args: []interface{}{"%" + fmt.Sprintf("%v", keyword)}}
}

func LikeRight(column string, keyword interface{}) *WherePair {
	return &WherePair{Query: column + " LIKE ?", Args: []interface{}{fmt.Sprintf("%v", keyword) + "%"}}
}

func Between(column string, value1, value2 interface{}) *WherePair {
	return &WherePair{Query: column + " BETWEEN ? AND ?", Args: []interface{}{value1, value2}}
}

func NotBetween(column string, value1, value2 interface{}) *WherePair {
	return &WherePair{Query: column + " NOT BETWEEN ? AND ?", Args: []interface{}{value1, value2}}
}

func In(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " IN (?)", Args: args}
}

func NotIn(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " NOT IN (?)", Args: args}
}

func Not(column string, args ...interface{}) *WherePair {
	return &WherePair{Query: column + " <> ?", Args: args}
}
